const util = require('util');
const Tool = require('./tool.js');

function print(leval = log, ...args){
    // console[leval](Tool.formatDate(), ...arguments);
    console[leval](util.format("%s [%s] ::: ", Tool.formatDate(), leval), ...args);
}

function debug(){
    print(arguments.callee.name, ...arguments);
}

function log(){
    print(arguments.callee.name, ...arguments);
}

function info(){
    print(arguments.callee.name, ...arguments);
}

function warn(){
    print(arguments.callee.name, ...arguments);
}

function error(){
    print(arguments.callee.name, ...arguments);
}

module.exports = { debug, log, info, warn, error };